<link rel="stylesheet" type="text/css" href="<?php echo base_url()."style.css"; ?>" />
<style type="text/css">
#warning
{
padding:10px;
margin-bottom:0px;
background-color:#E77471;
border-width:1px;
border-style: solid;
border-color:#A80000;
}
#success
{
padding:10px;
margin-bottom:0px;
background-color:#A8CBD4;
border-width:1px;
border-style: solid;
border-color:#04637A;
}
#headline 
{
font-weight:bold;
font-size:110%;
color:#e56506;
}

#ui-datepicker-div
{
left: 394px;
}

body
{
background-image: url(<?php echo base_url()."/images/white.gif"; ?>);
background-repeat: repeat-xy;
}

#grey
{
background-color: #E0E0E0;
}

.rightside
{
width:500px;
background-color: #E7EFEF;
border-style:solid;
border-width:1px;
border-color:#ff0000;
padding:10px 0 10px 20px;
align:center;
}
#admin
{
align:center;
}
</style>
<html>
<head>
<title>Admin</title>
	<meta charset="UTF-8" />

        <script type="text/javascript" src="<?php echo base_url(); ?>/jQuery/js/jquery-1.3.2.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>/jQuery/js/jquery-1.3.2.min.js"></script>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/lightbox/jquery.lightbox-0.5.css" media="screen" />
        <script type="text/javascript" src="<?php echo base_url(); ?>/lightbox/jquery.lightbox-0.5.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>/jQuery/js/jquery-ui.min.js"></script>


	<link type="text/css" href="<?php echo base_url(); ?>themes/base/jquery.ui.all.css" rel="stylesheet" />	
	<script type="text/javascript" src="<?php echo base_url()."script/"; ?>jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<?php echo base_url()."script/"; ?>jquery.ui.core.js"></script>
	<script type="text/javascript" src="<?php echo base_url()."script/"; ?>jquery.ui.widget.js"></script>
	<script type="text/javascript" src="<?php echo base_url()."script/"; ?>jquery.ui.datepicker.js"></script>
	<link type="text/css" href="<?php echo base_url()."css/"; ?>demos.css" rel="stylesheet" />
	<script type="text/javascript">
	$(function() {
		var dates = $('#from, #to').datepicker({
			defaultDate: "+1w",
			changeMonth: true,
			numberOfMonths: 3,
			onSelect: function(selectedDate) {
				var option = this.id == "from" ? "minDate" : "maxDate";
				var instance = $(this).data("datepicker");
				var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
				dates.not(this).datepicker("option", option, date);
			}
		});
	});
	</script>
	<script type="text/javascript">

  $(document).ready(function(){



    $('#event_start_date').datepicker({

			changeMonth: true,

			changeYear: true

		});

  });

</script>

<script type="text/javascript">

  $(document).ready(function(){



    $('#event_end_date').datepicker({

			changeMonth: true,

			changeYear: true

		});

  });

</script>

</head>
<!--search for the city first-->
					<?php	echo form_open('admin_search_pickup'); ?>
<center>
<table width="75%" align="center">	
	<tr>
		<td align="center">
			<div id="admin">
							<h2 id="font">Admin Panel - Lel-Ltd</h2>
							<a href="<?php echo base_url()."admin"; ?>">Back to Admin Home</a>
							<br />
							<br />
			</div>
		</td>
	</tr>
	<tr>
		<td>
				<table width="100%" align="center" style="border-width:1px; border-style: solid; border-color:#04637A; padding:20px 0 20px 0;">
					<tr>
						<td width="30%"></td>
						<td width="20%" id="headline">Search Quotation by Pickup Date<br><br></td>
						<td></td>
						<td width="30%"></td>
					</tr>
					<tr>
						<td width="30%"></td>
						<td width="20%">Start Date :</td>
<div class="demo">
						<td id="right" align=left><input id="event_start_date" name="start_date" type="text" value="<?php echo $start_date; ?>" ></td>	
</div>
						<td width="30%"></td>
					</tr>
					<tr>
						<td width="30%"></td>
						<td width="20%">End Date :</td>
<div class="demo">
						<td id="right" align=left><input id="event_end_date" name="end_date" type="text" value="<?php echo $end_date; ?>" ></td>	
</div>
						<td width="30%"></td>
						<br><br>
					</tr>
					<tr>
						<td width="30%"></td>
						<td width="20%"><?php	echo form_submit('search_quote', 'Search');	?>	</td>
						<td align=left></td>
						<td width="30%"></td>
					</tr>
				</table>

				<?php if(strcmp($success,"")!=0) {?>
				<p id="success"><?php echo $success; ?></p>
				<?php }?>
				<?php if(strcmp($warning,"")!=0) {?>
				<p id="warning"><?php echo $warning; ?></p>
				<?php }?>
	
				<!--table for quotation search-->				
				<table  width="100%"  style="padding:20px 0 20px 0;">
					<?php 
						if(isset($quote_list) && count($quote_list))
						{
					?>
							<br />
							<tr>
								<td colspan="7"><br><br><?php if(count($quote_list)==1) echo count($quote_list)." items found between the dates ".$start_date." and ".$end_date; else echo count($quote_list)." items found between the dates ".$start_date." and ".$end_date; ?>	<br><br><br></td>
							</tr>
							<tr>
<!--								<td width="5%"><b>ID</b></td>	-->
								<td width="18%"><b>Date Requested</b></td>
								<td width="18%"><b>Pickup Date</b></td>
								<td><b>Requester Name </b></td>
								<td><b>Phone </b></td>
								<td><b>Weight </b></td>
								<td><b>Pieces </b></td>
								<td><b>Details</b></td>
							</tr>
					<?php 
							$i=0;
							foreach($quote_list as $row) 
							{
								if($i%2==1)
								{
					?>
								<tr>
					<?php   	}
								else 
								{
					?>								
								<tr id="grey">
					<?php 		}				?>
<!--									<td align="center"><?php echo $row->quote_id; ?></td>	-->
									<td><?php echo $row->date; ?></td>
									<td><?php echo $row->pickup_date; ?></td>
									<td><?php echo $row->requester_name; ?></td>
									<td><?php echo $row->phone; ?></td>
									<td><?php echo $row->total_weight; ?></td>
									<td><?php echo $row->pieces; ?></td>
									<td align="center"><a id="view" href="<?php echo base_url()."admin_search_date/read_quotation/".$row->quote_id; ?>"><img width="20px" src="<?php echo base_url()."images/search-icon.png"?>" alt="view" /></a></td>
								</tr>
					<?php 
								$i++;
							}
						}
					?>
				</table>
		</td>
	</tr>
</table>
</center>
</html>